#ifndef __MOTOR_H_
#define __MOTOR_H_

#include "stdint.h"
#include "can.h"

typedef struct
{
    uint16_t can_id;
    int16_t  set_voltage;
    uint16_t rotor_angle;
    int16_t  rotor_speed;
    int16_t  torque_current;
    uint8_t  temp;
}moto_info_t;

extern moto_info_t motor_info[7];

#endif
void set_motor_voltage(uint8_t id_range, int16_t v1, int16_t v2, int16_t v3, int16_t v4);
void delay_us(uint16_t xus);
void delay_ms(uint16_t xms);
int32_t motor_round(int16_t angle_new);